package com.open.account.infrastructure.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * OpenAccountFlowPhase: 开户阶段   * 1 - 居民类型选择   * 2 - 身份证识别/Non-CA  ID识别   * 3 - 银行卡识别/Non-CA 银行结单上传   * 4 - 人脸识别/Non-CA 上传地址证明   * 5 - 选择账户类型   * 6 - 风险测评   * 7 - 设置签名   * 8 - 预览   * 9 - 已提交    
 */
public enum OpenAccountFlowPhase {
  
  NUMBER_1(1),
  
  NUMBER_2(2),
  
  NUMBER_3(3),
  
  NUMBER_4(4),
  
  NUMBER_5(5),
  
  NUMBER_6(6),
  
  NUMBER_7(7),
  
  NUMBER_8(8),
  
  NUMBER_9(9);

  private Integer value;

  OpenAccountFlowPhase(Integer value) {
    this.value = value;
  }

  @Override
  @JsonValue
  public String toString() {
    return String.valueOf(value);
  }

  @JsonCreator
  public static OpenAccountFlowPhase fromValue(String text) {
    for (OpenAccountFlowPhase b : OpenAccountFlowPhase.values()) {
      if (String.valueOf(b.value).equals(text)) {
        return b;
      }
    }
    return null;
  }
}

